I am using Google Map Version 3 API to add markers on Google Map.
The problem is that, markers show up on browsers.
but when users print the map through browser's print command, nothing shows up.
The question is,
- How can I display markers on printed materials? -
Comparisons:
On the browser - markers are clearly visible
After Print (IE7, IE8) - markers are not printed (on paper or PDF)
After Print (FireFox 3.5.4) - only markers are printed
I suggest you try out the Static Maps API. You can build a url that will return a static image (you can build your custom markers into the URL).
The browser will do a much better job of printing an image than it will do with a dynamic Google map.
I was able to print markers by using MarkerWithLabel in place of Google's Marker class which uses images in place of canvas.
In my print dialog there is a checkbox "print background images". When I enable it, the markers are printed. This link can help you: How can I force browsers to print background images in CSS?
I had no issue with printing the markers.
I've created my own markers and I use an <IMG> tag to stick the marker icon in.
The markers print fine on IE 8 on default settings.
Please find the link given below:
https://gist.github.com/jawsthegame/6801698
Using this you will be able to print Google Map along with custom markers.
You only need to make a change at line number 17.
Replace container.clone(); with $(container).clone();
Related
I'm looking for a way to use a custom UIView (not just a custom image) instead of default marker provided by Google Maps iOS SDK. Basically I need a possibility to place my UIView agains proper coordinates of the map, so not necessarily to use markers as they are, just any suitable solution. Any ideas?
There is not currently a way to do this. You can view the relevent feature request (and star it, to show interest) here: https://code.google.com/p/gmaps-api-issues/issues/detail?id=5203
The marker only shows an image. So it cannot take a CustomView. Moreover, if your custom view has some sort of button on it there is no way you can track the events from those button.
In simple words the map renders the markers as UIImage.
How do I add a larger map marker image to an Overlay? I'm using KMLLayer and the icon url is inside my KML file. Google Maps appears to scale it down when i link to the larger icon.
I tried the inside the KML but that didn't have any effect on the size of the image or something else is overriding it.
I believe it forces it to 32x32, but I need one at least twice that for a touch screen/kiosk app. My icon is 64x64.
Thanks,
Don
Using geoxml3, the kmz branch, your icons are displayed full size (if you change the <scale>0</scale> to <scale>1</scale>.
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmztest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/doubletaketech_net_RigsB.kml
geoxml3 parses the KML in the client and renders the markers as native Google Maps API v3 markers. For large numbers, KmlLayer is a better option, as it is rendered as tiles, but it doesn't seem to render markers at their native size, and it doesn't support the scale tag
It also looks like you have the <hotspot> defined incorrectly:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmztest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/doubletaketech_net_RigsC.kml
I am using the Static Google Maps API v2 to download a static image of a map view with a singular marker just showing one image. However, the image added to the marker parameter of the url doesn't seem to be making any difference, and just a red marker is shown at the location.
Please can you tell me where I am going wrong?
http://maps.googleapis.com/maps/api/staticmap
?center=37.446754,-77.572746
&size=70x61
&maptype=roadmap
&sensor=true
&scale=2
&zoom=15
&key=some_key
&markers=icon:https://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746
your image URL must remove the letter S HTTPS secure site, so work, for example like this:
http://foursquare.com/img/categories_v2/shops/financial_bg_64.png
complete code:
http://maps.googleapis.com/maps/api/staticmap?
center=37.446754,-77.572746&size=70x61&maptype=roadmap&sensor=false
&scale=2&zoom=15
&markers=icon:http://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746
In my experience,
There is no such requirement of http or https just care for icon size .
icon size should not exceed more than 64X64 pixels in size , Static map will happily show the custom icon . accept if found correct #max_
http://maps.googleapis.com/maps/api/staticmap?
center=37.446754,-77.572746&size=70x61&maptype=roadmap&sensor=false
&scale=2&zoom=15
&markers=icon:http://foursquare.com/img/categories_v2/shops/financial_64X64.png|37.446754,-77.572746
off course use your image with below 64X64 dimension instead of
http://foursquare.com/img/categories_v2/shops/financial_64X64.png
You're actually not doing anything wrong, it's Google to blame:
"The Google Static Maps API does not support custom icon URLs that use HTTPS"
I print google map with satellite mode in my page using google map api 3.0. now can i printed window of google map in print firenldy mode. i dont have any idea for this !!!
google map load in :
<div id="mapdiv"></div>
Thanks
Is there anything specific to the google maps that would affect the print style?
Assuming no, I think you want to look into CSS media queries and define styles for print mode. I would guess you want to do things like hide navigation elements and perhaps make the map div bigger.
http://css-tricks.com/css-media-queries/
I am using GeoServer for extracting polygons from shapefile then I use them with OpenLayers JS API and project them on Google maps base layer. All set, everything works fine.
I display 2 WMS layers over Google maps base layer, they looks fine in print preview in all browsers but when I print them
FireFox: Got correct print, all the layers printed correctly.
IE/Chrome: only last layer added to map is printed if its not gmap layer.
map.addLayers([gmap, wms1, wms2, vectors]);
here the polygon from wms2 is printed, if I switch them then wms1 is printed and google layer is never printed (even if I put that in last).
Please suggest if you know any workaround or any problem in the way I am doing it. I have already checked advanced option in IE to print image and background but no effect.
Thank you.
Anybody?
Solved.
The problem was with 'opacity': 0.80 parameter while getting polygon from both WMS layers.Although I don't know it for sure but it's the problem with printing Opaque images in IE/Chrome.
In case anybody face the same problem, don't use opacity.